package com.learn.mybatis.springboot.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户信息
 *
 * @author cong zhi
 * @email 448341911@qq.com
 * @createDate 2023/2/24 14:35
 * @version: v1.0
 */
@Data
public class User implements Serializable {
    private static final long serialVersionUID = 6573530203605795844L;
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    protected Integer id;
    /**
     * 姓名
     */
    private String userName;
    /**
     * 年龄
     */
    private Integer age;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    protected String createBy;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime createTime;
    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime updateTime;

    /**
     * 删除标记,1:已删除,0:正常
     */
    @TableLogic
    protected Integer isDel;
}
